package com.example.mapp;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectKey;

import com.example.entity.supervision.UsedControlInspection;

/**
 * Created by douyx on 2018/03/26.
 */
@Mapper
public interface UsedControlInspectionMapp {

	@Select(" select * from used_control_inspection where id = #{id} ")
	UsedControlInspection query(String id) throws Exception;

	@Insert(" insert into used_control_inspection (safe_person,response_system,emergency_drill,archives,"
			+ "validate_inspection,regular_check,validate_certificates,training_record)" + " value "
			+ "(#{safePerson},#{responseSystem},#{emergencyDrill},#{archives},"
			+ "#{validateInspection},#{regularCheck},#{validateCertificates},#{trainingRecord})")
	@SelectKey(statement = "select last_insert_id()", keyProperty = "id", keyColumn = "id", before = false, resultType = Long.class)
	public int add(UsedControlInspection usedControlInspection) throws Exception;
}
